package com.zxm.web.handler;

import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.context.request.async.AsyncRequestTimeoutException;

/**
 * @Author silence.Z
 * @Date 2022/8/29 9:47
 * @PackageName:com.zxm.web.handler
 * @ClassName: AsyncRequestTimeoutHandler
 * @Description: TODO
 * @Version 1.0
 */
@ControllerAdvice
public class AsyncRequestTimeoutHandler {

	@ResponseStatus(HttpStatus.NOT_MODIFIED)
	@ResponseBody
	@ExceptionHandler(AsyncRequestTimeoutException.class)
	public String asyncRequestTimeoutHandler(AsyncRequestTimeoutException e) {
		System.out.println("异步请求超时");
		return "304";
	}
}

